# !/usr/bin/env python
# coding=utf-8
# @Time    : 2018/7/13 17:19
# @Author  : 6imensiva
# @Site    : https://gitee.com/dimensiva/rpc_dao.git
# @File    : test.py
# @Software: PyCharm
# @Version: 2.7.5
from thrift.transport import TSocket
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
from thrift.server import TServer


class TestHandler:
    ''' CalcHandler '''

    def add_string(self, a, b):
        ''' add '''
        print(a, b)
        return a + b


def aaa(bbb):
	print(bbb)

def aaa(bbb, ccc):
	print(123123123123, bbb, ccc)

if __name__ == '__main__':
    # HANDLER = TestHandler()
    # PROCESSOR = Processor(HANDLER)
    # TRANSPORT = TSocket.TServerSocket('0.0.0.0', port=9090)
    # TFACTORY = TTransport.TBufferedTransportFactory()
    # PFACTORY = TBinaryProtocol.TBinaryProtocolFactory()
    # SERVER = TServer.TSimpleServer(PROCESSOR, TRANSPORT, TFACTORY, PFACTORY)
    #
    # print('Starting the server...')
    # SERVER.serve()
    # print('done.')

    # from db import user_dao
    # from idl_output.ttypes import UserProfile
    # a = UserProfile(user_name='ccc', pwd='uuuu', type_id=1)
    # print(user_dao.add_user(a))

    # aaa(123, 456)

    # from idl_output.ttypes import CustomerInfoDB
    # aaa = CustomerInfoDB()
    # aaa.id = 1
    # aaa.user_id = 222
    # from db.models import TCustomerInfo
    # bbb = TCustomerInfo()
    # bbb.user_id = 3
    # bbb.id = 65675
    # print('11111111111111', aaa)
    # from py3_utils import my_thrift
    # ccc = my_thrift.obj_copy_with_same_name(bbb, aaa)
    # print('11111111111111', aaa)
    # print('22222222222222', bbb)
    # from py3_utils import my_print
    # my_print.print_obj(bbb)

    from service import customer_service
    print(customer_service.get_customer_list(29))